﻿using System.Collections.Generic;
using System.ServiceModel;
using Pku.BookStore.Model;

namespace Pku.BookStore.IServices
{
    [ServiceContract(Name = "IProductServices", Namespace = "Pku.BookStore.IServices")]
    public interface IProductServices
    {
        /// <summary>
        /// 增加图书信息
        /// </summary>
        /// <param name="entity"></param>
        [OperationContract(Name = "Add")]
        int Add(ProductModel entity);

        /// <summary>
        /// 修改图书信息
        /// </summary>
        /// <param name="entity"></param>
        [OperationContract(Name = "Modify")]
        bool Modify(ProductModel entity);

        /// <summary>
        /// 查询
        /// </summary>
        /// <returns></returns>
        [OperationContract(Name = "Search")]
        List<ProductModel> Search(ProductParam param);

        /// <summary>
        /// 获取总数
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        [OperationContract(Name = "GetCount")]
        int GetCount(Model.ProductParam param);

        /// <summary>
        /// 获取订单实体
        /// </summary>
        /// <param name="bookID"></param>
        /// <returns></returns>
        [OperationContract(Name = "GetEntityById")]
        ProductModel GetEntityById(int bookID);

        /// <summary>
        /// 是否存在
        /// </summary>
        /// <param name="Str">关键字</param>
        /// <returns></returns>
        [OperationContract(Name = "Exist")]
        bool Exist(string Str);

        /// <summary>
        /// 修改图书封面
        /// </summary>
        /// <param name="entity"></param>
        [OperationContract(Name = "ModifyImg")]
        bool ModifyImg(ProductModel entity);

        /// <summary>
        /// 热售产品
        /// </summary>
        /// <param name="Top">Top</param>
        /// <param name="CateID">分类</param>
        /// <returns></returns>
        [OperationContract(Name = "GetSaleHot")]
        List<ProductModel> GetSaleHot(int Top, int CateID);

        /// <summary>
        /// 查询数量
        /// </summary>
        /// <returns></returns>
        [OperationContract(Name = "SearchCount")]
        int SearchCount(ProductParam param);

    }
}
